package com.hundsun.cprs.yyt.service.common.dto;

import java.util.Date;

import com.hundsun.cprs.yyt.common.base.DtoBase;
import com.hundsun.cprs.yyt.common.enums.EnumBusinessCode;
import com.hundsun.cprs.yyt.common.exception.ServiceCodeException;
import com.hundsun.cprs.yyt.service.common.enums.EnumUserType;

/**
 * @author linbo
 * @version 创建时间：2014-7-1 下午4:25:51 手机端查询用户信息结果
 */
public class UserAccountDTO extends DtoBase {

	private static final long serialVersionUID = -5431528798153329994L;

	/**
	 * PK/用户ID
	 */
	private Long id;

	/**
	 * 账户名
	 */
	private String account;

	/**
	 * 名称
	 */
	private String name;
	
	//昵称
	private String nickName;
	
	//头像URL
	private String headImgUrl;

	/**
	 * 密码,加密形式
	 */
	private String password;

	/**
	 * 电话号码
	 */
	private String phone;

	/**
	 * 手机号码
	 */
	private String mobile;

	/**
	 * 证件类型(Identity-身份证;License-营业执照)
	 * <p>
	 * 
	 */
	private String certificateType;

	/**
	 * 证件号码
	 */
	private String certificateNum;

	/**
	 * 证件附件地址,多个附件地址用;分隔
	 */
	private String certificatePath;

	/**
	 * 电子邮件
	 */
	private String email;
	//性别 M:男;F:女
	private String gender;
	
	private Integer age;
	//个人简介
	private String remak;

	/**
	 * 邮政编码
	 */
	private String zipCode;

	/**
	 * 省份
	 */
	private String province;

	/**
	 * 城市
	 */
	private String city;

	/**
	 * 地区
	 */
	private String area;

	/**
	 * 地址(不包含省市地区)
	 */
	private String address;

	/**
	 * 全称(企业)
	 */
	private String fullName;

	/**
	 * 企业简介
	 */
	private String intro;

	/**
	 * 主页
	 */
	private String homePage;

	/**
	 * 经营范围
	 */
	private String scope;

	/**
	 * 税号
	 */
	private String taxNum;

	/**
	 * 用户等级(此字段当前未用，只做保留,查找用户等级可以使用角色表查找)
	 */
	private String userClass;

	/**
	 * 用户状态
	 */
	private String status;
	
	//状态描述
	private String statusDesc;

	/**
	 * 信用等级
	 */
	private Long creditClass;

	/**
	 * 激活码
	 */
	private String activeCode;

	// /**
	// * 记录产生时间
	// */
	// private Date gmtCreate;
	//
	// /**
	// * 记录最后一次修改时间
	// */
	// private Date gmtModify;

	/**
	 * 操作人
	 */
	private String operator;

	/**
	 * 最后一次登陆IP
	 */
	private String lastLoginIp;

	/**
	 * 最后一次登陆时间
	 */
	private Date lastLoginTime;

	/**
	 * 是否需要激活
	 */
	private boolean isShouldActive;

	/**
	 * 资金账号
	 */
	private String fundAccount;

	/**
	 * 支付密码
	 */
	private String fundPassword;

	/**
	 * 开户银行
	 */
	private String bank;

	/**
	 * 银行账号
	 */
	private String bankCard;

	/**
	 * 联系人
	 */
	private String contact;

	/**
	 * 会员code编号
	 */
	private String partCode;
	/**
	 * 交易账号
	 */
	private String taAccount;
	
	/**
	 * 用户类型(用于修改请求{@link EnumUserType})
	 */
	private String userType;
	
	/**
	 * 授权服务机构账号
	 */
	private String parentAgentUser;
	
	/**
	 * 居间人账号
	 */
	private String parentMidUser;
	
	
	/**
	 * 会员推广码
	 */
	private String fr;
	/**
	 * 会员等级(勋章等级)
	 */
	private String mchtLevel;

	/**
	 * 身份证前面图片
	 */
	private String certFrontImgUrl;
	/**
	 * 身份证反面图片
	 */
	private String certReverseImgUrl;

	/**
	 * 审核备注
	 */
	private String auditRemark;

	/**
	 * 会员当前的经验值
	 *
	 * */
	private String integral;

	/**
	 * 用户会话令牌
	 */
	private String sessionToken;

	private String partCategories1;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getCertificateType() {
		return certificateType;
	}

	public void setCertificateType(String certificateType) {
		this.certificateType = certificateType;
	}

	public String getCertificateNum() {
		return certificateNum;
	}

	public void setCertificateNum(String certificateNum) {
		this.certificateNum = certificateNum;
	}

	public String getCertificatePath() {
		return certificatePath;
	}

	public void setCertificatePath(String certificatePath) {
		this.certificatePath = certificatePath;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getZipCode() {
		return zipCode;
	}

	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getArea() {
		return area;
	}

	public void setArea(String area) {
		this.area = area;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getFullName() {
		return fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	public String getIntro() {
		return intro;
	}

	public void setIntro(String intro) {
		this.intro = intro;
	}

	public String getHomePage() {
		return homePage;
	}

	public void setHomePage(String homePage) {
		this.homePage = homePage;
	}

	public String getScope() {
		return scope;
	}

	public void setScope(String scope) {
		this.scope = scope;
	}

	public String getTaxNum() {
		return taxNum;
	}

	public void setTaxNum(String taxNum) {
		this.taxNum = taxNum;
	}

	public String getUserClass() {
		return userClass;
	}

	public void setUserClass(String userClass) {
		this.userClass = userClass;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Long getCreditClass() {
		return creditClass;
	}

	public void setCreditClass(Long creditClass) {
		this.creditClass = creditClass;
	}

	public String getActiveCode() {
		return activeCode;
	}

	public void setActiveCode(String activeCode) {
		this.activeCode = activeCode;
	}

	public String getOperator() {
		return operator;
	}

	public void setOperator(String operator) {
		this.operator = operator;
	}

	public String getLastLoginIp() {
		return lastLoginIp;
	}

	public void setLastLoginIp(String lastLoginIp) {
		this.lastLoginIp = lastLoginIp;
	}

	public Date getLastLoginTime() {
		return lastLoginTime;
	}

	public void setLastLoginTime(Date lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}

	public boolean isShouldActive() {
		return isShouldActive;
	}

	public void setShouldActive(boolean isShouldActive) {
		this.isShouldActive = isShouldActive;
	}

	public String getFundAccount() {
		return fundAccount;
	}

	public void setFundAccount(String fundAccount) {
		this.fundAccount = fundAccount;
	}

	public String getFundPassword() {
		return fundPassword;
	}

	public void setFundPassword(String fundPassword) {
		this.fundPassword = fundPassword;
	}

	public String getBank() {
		return bank;
	}

	public void setBank(String bank) {
		this.bank = bank;
	}

	public String getBankCard() {
		return bankCard;
	}

	public void setBankCard(String bankCard) {
		this.bankCard = bankCard;
	}

	public String getContact() {
		return contact;
	}

	public void setContact(String contact) {
		this.contact = contact;
	}

	public String getPartCode() {
		return partCode;
	}

	public void setPartCode(String partCode) {
		this.partCode = partCode;
	}

	public String getTaAccount() {
		return taAccount;
	}

	public void setTaAccount(String taAccount) {
		this.taAccount = taAccount;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getHeadImgUrl() {
		return headImgUrl;
	}

	public void setHeadImgUrl(String headImgUrl) {
		this.headImgUrl = headImgUrl;
	}

	public String getStatusDesc() {
		return statusDesc;
	}

	public void setStatusDesc(String statusDesc) {
		this.statusDesc = statusDesc;
	}
	
	public boolean isRealName(){
		if(getStatus() == null || "6".equals(getStatus()))
			return false;
		return true;
	}

	public boolean canBid() throws ServiceCodeException{
		if (isNormal())
			return true;
		if (isAuditFail())
			throw new ServiceCodeException(EnumBusinessCode.BUSINESS_1031);
		if (isAudit())
			throw new ServiceCodeException(EnumBusinessCode.BUSINESS_1032);
		if (isToActive())
			throw new ServiceCodeException(EnumBusinessCode.BUSINESS_1033);
		return false;
	}

	/**
	 * 是否审核不通过状态
	 * @return
	 */
	public boolean isAuditFail() {
		if (getStatus() != null && "1".equals(getStatus()))
			return true;
		return false;
	}

	/**
	 * 是否待审核
	 * @return
	 */
	public boolean isAudit() {
		if (getStatus() != null && "2".equals(getStatus()))
			return true;
		return false;
	}
	/**
	 * 是否正常状态
	 * @return
	 */
	public boolean isNormal() {
		return "3".equals(getStatus());
	}

	/**
	 * 是否待实名
	 * @return
	 */
	public boolean isToActive() {
		if (getStatus() != null && "6".equals(getStatus()))
			return true;
		return false;
	}

	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public String getRemak() {
		return remak;
	}

	public void setRemak(String remak) {
		this.remak = remak;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public String getParentAgentUser() {
		return parentAgentUser;
	}

	public void setParentAgentUser(String parentAgentUser) {
		this.parentAgentUser = parentAgentUser;
	}

	public String getParentMidUser() {
		return parentMidUser;
	}

	public void setParentMidUser(String parentMidUser) {
		this.parentMidUser = parentMidUser;
	}
	
	public String getDisplayName(){
		return (getNickName() != null && getNickName().length() > 0)?getNickName():getName();
	}

    public String getFr() {
        return fr;
    }

    public void setFr(String fr) {
        this.fr = fr;
    }

    public String getMchtLevel() {
        return mchtLevel;
    }

    public void setMchtLevel(String mchtLevel) {
        this.mchtLevel = mchtLevel;
    }

	public String getCertFrontImgUrl() {
		return certFrontImgUrl;
	}

	public void setCertFrontImgUrl(String certFrontImgUrl) {
		this.certFrontImgUrl = certFrontImgUrl;
	}

	public String getCertReverseImgUrl() {
		return certReverseImgUrl;
	}

	public void setCertReverseImgUrl(String certReverseImgUrl) {
		this.certReverseImgUrl = certReverseImgUrl;
	}

	public String getAuditRemark() {
		return auditRemark;
	}

	public void setAuditRemark(String auditRemark) {
		this.auditRemark = auditRemark;
	}

	public String getIntegral() {
		return integral;
	}

	public void setIntegral(String integral) {
		this.integral = integral;
	}

	public String getSessionToken() {
		return sessionToken;
	}

	public void setSessionToken(String sessionToken) {
		this.sessionToken = sessionToken;
	}

	public String getPartCategories1() {
		return partCategories1;
	}

	public void setPartCategories1(String partCategories1) {
		this.partCategories1 = partCategories1;
	}
}